<?php


/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Restricted access');
?>
		<div style="display:none;" id="currentSuffix">0</div>	
		<?php
		echo "<form action='{$this->formAction}' method='post' name='adminForm' id='adminForm' enctype='multipart/form-data'>";
		?>
		<table class="adminheading">
		<tr>
			<th class='helpdesk_ticket'>
			<?php echo HelpDeskText::_( 'New Ticket' ); ?>
			</th>            
		</tr>
		</table>
                
        <div class="note"><?php echo HelpDeskText::_( 'Categorize Ticket' ); ?></div>

		<div id='onBeforeDisplay_wrapper'>
			<?php 
				$dispatcher = HelpDeskHelperPlugin::getInstance();
				$dispatcher->trigger( 'onBeforeDisplayTicketForm', array( $this->row, $this->user ) );
			?>
		</div>                

			<table class="userlist">
            <thead>
                <tr>
                    <th colspan="2">
                    <?php echo HelpDeskText::_( 'Details' ); ?>
                    </th>
                </tr>
            </thead>

			<tbody>
                <tr>
                  <td class='title'><?php echo HelpDeskText::_( 'User' ); ?>: *</td>
                  <td class="input">
					<?php echo $this->ticketUser->name." (".$this->ticketUser->email.") [".$this->ticketUser->id."]"; ?>
                    <input name="userid" type="hidden" class="text_area" size='50' value="<?php echo $this->ticketUser->id; ?>"/>
                  </td>
                </tr>
                <tr>
                  <td class='title'><?php echo HelpDeskText::_( 'Category' ); ?>: *</td>
                  <td class="input">
					<?php echo $this->lists['categoryid']; ?>
                  </td>
                </tr>
                <tr>
                  <td class='title'><?php echo HelpDeskText::_( 'Subject' ); ?>: *</td>
                    <td class="input">
                    <input name="subject" type="text" class="text_area" size='50' />
                    </td>
                </tr>
                <tr>
                  <td class='title'><?php echo HelpDeskText::_( 'Comments' ); ?>: *</td>
                    <td class="input">
						<?php 
							$commentbox = new stdClass();
							$commentbox->display = '<textarea name="description" class="text_area" rows="10" width="98%" style="width:98%" ></textarea>';
							$dispatcher =& HelpDeskHelperPlugin::getInstance();
							$dispatcher->trigger( 'onBeforeDisplayCommentBox', array( &$commentbox, $this->row, $this->user ) );
							echo $commentbox->display;
						?>
                    </td>
                </tr>
            </tbody>
	        </table>

			<div id='additional_info_wrapper'>
						<?php echo $this->fieldLists; ?>
			</div>

			<?php /* TODO Move this to a plugin */ ?>
	        <?php if ($this->config->files_enable) { ?>
	                        
				<?php
				// display title
				$title = HelpDeskText::_( 'Attachments' );
				
				$html = '<p>
						<table class="userlist">
							<thead>
								<tr>
									<th class="title">'.
									$title
									.'</th>
								</tr>
							</thead>
						  </table>
						  </p>
						  ';
				echo $html;
				?>
	            <div class="note"><?php echo HelpDeskText::_( 'Attachment Intro' ); ?></div>
	            
	            <table class="userlist">
	            <tr>
	              <td class="input">
	              <input class="text_area" name="userfile" type="file" size="25"/>
	              </td>
	            </tr>
	            </table>
				
			<?php } ?> 

		<div id='onAfterDisplay_wrapper'>
			<?php 
				$dispatcher =& HelpDeskHelperPlugin::getInstance();
				$dispatcher->trigger( 'onAfterDisplayTicketForm', array( $this->row, $this->user ) );
			?>
		</div>
		
		<p>* <?php echo HelpDeskText::_( 'Required Field' ); ?></p>

		<input type="hidden" name="option" value="<?php echo $this->formOption; ?>" />
		<input type="hidden" name="controller" value="<?php echo $this->formController; ?>" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="id" value="<?php echo $this->formId; ?>" />
		<input type="hidden" name="boxchecked" value="" />
		<input type="hidden" name="order" value="<?php echo @$this->order; ?>" />
		<input type="hidden" name="order_dir" value="<?php echo @$this->order_dir; ?>" />
        
		<?php
		echo $this->formValidate;
		echo "</form>";
		?>